import { defineStore } from "pinia";
import { ref, computed } from "vue";

interface menuButtonInfo{
	top:number,
	height:number
}
export const useConfigStore = defineStore("config", () => {
	const menuButtonInfo = ref({
		top: 51,
		height: 32,
	});
	const tabbarIndex = ref(0);
	const setmenuButtonInfo = (info:menuButtonInfo) => {
		menuButtonInfo.value = info;
	};
	const setTabbarIndex = (index:number) => {
		tabbarIndex.value = index;
	};
	const menuButtonInfoGetter = computed(() => {
		return menuButtonInfo.value;
	});
	const paddingTop = computed(() => {
		return menuButtonInfo.value.top + menuButtonInfo.value.height;
	});
	const tabbarIndexGetter = computed(() => {
		return tabbarIndex.value;
	});
	return {
		menuButtonInfo,
		setmenuButtonInfo,
		setTabbarIndex,
		menuButtonInfoGetter,
		paddingTop,
		tabbarIndexGetter,
	};
});
